package com.example.springbootdemo.observe;

/**
 * @author ：cici
 * @date ：Created in 2019/8/27 17:57
 */
public class Test {

    public static void main(String[] args) {
        TheObserver server = new TheObserver();

        Observer userZhang = new User("ZhangSan");
        Observer userLi = new User("LiSi");
        Observer userWang = new User("WangWu");

        server.registerObserver(userZhang);
        server.registerObserver(userLi);
        server.registerObserver(userWang);
        server.setInfomation("PHP是世界上最好用的语言！");

        System.out.println("----------------------------------------------");
        server.removeObserver(userZhang);
        server.setInfomation("JAVA是世界上最好用的语言！");

    }

}
